<template>
  <div>
    <div v-for="category in categories" :key="category.name" class="category">
      <h3>{{ category.name }}</h3>
      <ul>
        <li v-for="product in category.products" :key="product.name">
          {{ product.name }} - 💰{{ product.price }}
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      categories: [
        {
          name: '电子产品',
          products: [
            { name: '手机📱', price: 3999 },
            { name: '耳机🎧', price: 599 }
          ]
        },
        {
          name: '食品',
          products: [
            { name: '面包🍞', price: 10 },
            { name: '牛奶🥛', price: 8 }
          ]
        }
      ]
    };
  }
};
</script>